package com.deram.ctin.serv.business.impl;

import com.deram.ctin.common.bean.PageResult;
import com.deram.ctin.serv.business.api.BusinessEnforcementApi;
import com.deram.ctin.serv.business.entity.BaseUpdateInfo;
import com.deram.ctin.serv.business.entity.BusinessEnforcement;
import com.deram.ctin.serv.business.filter.BusinessEnforcementFilter;
import com.deram.ctin.serv.business.service.BusinessEnforcementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: jtt
 * @Description:
 * @Date: 2017/9/13 15:57
 * @version: V1.0
 */
@RestController
public class BusinessEnforcementApiImpl implements BusinessEnforcementApi {

    @Autowired
    BusinessEnforcementService businessEnforcementService;

    @Override
    public List<BusinessEnforcement> list(@RequestBody BusinessEnforcementFilter filter) {
        return businessEnforcementService.list(filter);
    }

    @Override
    public BusinessEnforcement save(@RequestBody BusinessEnforcement param) {
        return businessEnforcementService.save(param);
    }

    @Override
    public PageResult<BusinessEnforcement> search(@RequestBody BusinessEnforcementFilter filter, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) {
        return businessEnforcementService.search(filter, pageNo, pageSize);
    }

    @Override
    public void delete(Long id) {
        businessEnforcementService.delete(id);
    }

    @Override
    public void saveList(@RequestBody BaseUpdateInfo<BusinessEnforcement> updateInfo) {
        businessEnforcementService.saveList(updateInfo);
    }
}
